<template>
    <div class="realtime">
        <div id="container" style="min-width:400px;height:400px"></div>
    </div>
</template>


<script>
export default {
    data(){
        return {
            list_data:[1,2,3,1,1,2,3,3,1,4,5,6]
        }
    },
    mounted(){
        this.init();
    },
    methods:{
        init(){
            var chart = Highcharts.chart('container', {
            chart: {
                type: 'spline'
            },
            title: {
                text: '中国疫情展示'
            },
            subtitle: {
                text: '数据来源: 中国疾控中心'
            },
            xAxis: {
                categories: ['一月', '二月', '三月', '四月', '五月', '六月',
                            '七月', '八月', '九月', '十月', '十一月', '十二月']
            },
            yAxis: {
                title: {
                    text: '人数'
                },
                labels: {
                    formatter: function () {
                        return this.value + '°';
                    }
                }
            },
            tooltip: {
                crosshairs: true,
                shared: true
            },
            plotOptions: {
                spline: {
                    marker: {
                        radius: 4,
                        lineColor: '#666666',
                        lineWidth: 1
                    }
                }
            },
            series: [{
                name: '中国',
                marker: {
                    symbol: 'square'
                },

                // 后期可以把data改成接口对接
                data: this.list_data
                }]
            });

        }
    }
}
</script>